import csv

def writeCsv(path, data):
    with open(path, "w", newline = "") as f:
        writer = csv.writer(f)
        for rowData in data:
            writer.writerow(rowData)


path = r"C:\Users\Acer\Desktop\CSV文件2.csv"
writeCsv(path, [[1,2,3,],[4,5,6],[7,8,9]])